1. Field of the Invention
The present invention relates to an image processing apparatus for reading an image of a document set on a document positioning plate of an image reading apparatus and processing and outputting the read image, and more particularly to an image processing apparatus for outputting an image of a document area set on a document positioning plate.
2. Description of the Related Art
Image reading apparatuses for use in digitizing and inputting data on paper medium to personal computers (PCs) include an imaging scanner, a multifunctional peripheral, and the like. These image reading apparatuses are capable of reading various types of documents, such as a monochrome image of a text document, a color image of a magazine, a developed photograph, and a negative or positive film.
An image read by such an image reading apparatus corresponds to an image on the entire document positioning plate and can include an image other than an image of a document. As a function convenient for outputting an image, a function of automatically determining only a document area and outputting only an image of the document area can be used. When a plurality of documents is set on the document positioning plate, a function of outputting a smallest rectangular area including images of all of the plurality of documents and a function of outputting each rectangular area including an image of each document can be selectively used.
In existing scanners, a reading start position thereof is not a reference position at an end of a document positioning plate, which is a position that a document abuts on, but a position slightly inside the document positioning plate, because of mechanical accuracy. This is for the purpose of preventing a part of an abutting portion from being scanned and read due to a mechanical assembling error. A margin of a front end of a document from the reference position in a vertical direction is referred to as a “front end registration”. A margin of a left end of the document from the reference position in a horizontal direction is referred to as a “left end registration”. The same applies to rear and right ends of the document. Thus, since less than the entire image on the document positioning plate can be read, when a document of a size close to the size of the document positioning plate is placed thereon and scanned, image information of some edges of the document may not be obtained.
In general, information of edges of the document is essential for an automatic document area trimming process. This automatic document area trimming process may fail if image information of all of the edges of the document is not obtained. Specifically, only an image part of the document may be trimmed, or an image of an end of the document may be omitted. For example, FIG. 3A illustrates a document 303 set on a document positioning plate 302 with a corner thereof adjusted to a reading reference position mark 301, as viewed from a reading surface. Only a slight difference exists in longitudinal length between the document 303 and the document positioning plate 302. Thus, a read image 305 is obtained in which image information of a bottom edge of the document 303 cannot be obtained due to an influence of front, rear, left, and right end registrations. When the read image 305 is subjected to edge extraction, an edge 402 is obtained as illustrated in FIG. 4B. In this case, an edge corresponding to the bottom edge of the document 303 cannot be obtained. Only the edge 402 and an edge of an image 403 inside the document 303 are obtained. A smallest rectangle 404 including the edge 402 is obtained as illustrated in FIG. 4C. If the rectangle 404 is subjected to trimming, an image of the left-hand portion of the document is omitted.
Japanese Patent Application Laid-Open No. 2001-268367 discusses a method for detecting and distinguishing a document area from another area by applying a pattern to a component of an image reading apparatus serving as a background of a read image. Japanese Patent Application Laid-Open No. 2004-096435 discusses a method for analyzing a pixel value distribution of a read image to specify an edge highly likely to be a document edge between a background and a document. However, the former method is costly because the apparatus itself must be processed. The latter method is inapplicable when no edge exists in the read image due to an influence of front and left end registrations.